import 'package:ai/components/RatingWidget.dart';
import 'package:ai/util/CommonUtils.dart';
import 'package:auto_route/annotations.dart';
import 'package:flutter/material.dart';

import '../../config/Config.dart';

@RoutePage()
class SatisfactionPage extends StatefulWidget {
  const SatisfactionPage({super.key});

  @override
  State<SatisfactionPage> createState() => _SatisfactionPageState();
}

class _SatisfactionPageState extends State<SatisfactionPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.white,
      appBar: CommonUtils.getAppBar("满意度测评", () {}),
      body: ListView(
        children: [
          const SizedBox(
            height: 48,
          ),
          Row(
            mainAxisAlignment: MainAxisAlignment.spaceAround,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              const Expanded(
                child: SizedBox(),
              ),
              Container(
                height: 2,
                width: 64,
                decoration: BoxDecoration(
                  color: Config.colorD6DaDb,
                ),
              ),
              const SizedBox(
                width: 24,
              ),
              Text(
                "满意度打分",
                style: TextStyle(
                  color: Config.colorA8,
                  fontSize: 16,
                ),
              ),
              const SizedBox(
                width: 24,
              ),
              Container(
                height: 2,
                width: 64,
                decoration: BoxDecoration(
                  color: Config.colorD6DaDb,
                ),
              ),
              const Expanded(
                child: SizedBox(),
              ),
            ],
          ),
          const SizedBox(
            height: 24,
          ),
          RatingWidget(
            initialRating: 3,
            maxRating: 5,
            onRatingChanged: (rating) {
              print('Selected rating: $rating');
            },
          ),
          Padding(
            padding: const EdgeInsets.all(16),
            child: Container(
              padding: const EdgeInsets.all(4),
              decoration: BoxDecoration(
                border: Border.all(
                  color: Config.color69f,
                  width: 1.5,
                ),
                borderRadius: BorderRadius.circular(8),
                color: Config.colorF8,
              ),
              child: const TextField(
                maxLines: 12,
                minLines: 12,
                maxLength: 200,
                decoration: InputDecoration(
                  hintText: "请输入您的评价，是否有什么意见或建议",
                  border: InputBorder.none,
                ),
              ),
            ),
          ),
          Padding(
            padding: const EdgeInsets.all(24),
            child: FilledButton(
              style: ButtonStyle(
                backgroundColor: WidgetStateProperty.all(
                  Config.color5490ff,
                ),
              ),
              onPressed: () {},
              child: const Text("确认评价"),
            ),
          )
        ],
      ),
    );
  }
}
